<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>List Address</title>
<link rel="stylesheet" type="text/css"
	href="<{$APPLICATION_URL}>/Themes/<{$templateName}>/styles/m_style.css"
	media="screen" />
<script type="text/javascript"
	src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/js/jquery.min.js"></script>
<script type="text/javascript">
var $ = jQuery.noConflict();
	$(function() {
		$('#activator').click(function(){
				$('#box').animate({'top':'65px'},500);
		});
		$('#boxclose').click(function(){
				$('#box').animate({'top':'-400px'},500);
		});
		$('#activator_share').click(function(){
				$('#box_share').animate({'top':'65px'},500);
		});
		$('#boxclose_share').click(function(){
				$('#box_share').animate({'top':'-400px'},500);
		});
		$('#activator_login').click(function(){
				$('#box_login').animate({'top':'65px'},500);
		});
		$('#boxclose_login').click(function(){
				$('#box_login').animate({'top':'-400px'},500);
		});

	});
	$(document).ready(function(){
	$(".toggle_container").hide(); 
	$(".trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false;
	});
	
	});
</script>
<meta charset="UTF-8">

</head>

<body>
	<div id="main_container">
		<div class="header">
			<a href="<{$APPLICATION_URL}>/<{$ownerName}>" class="left_bt">home</a>
			<a href="<{$APPLICATION_URL}>/<{$ownerName}>MyAccount" class="left_bt">account</a>
			<span>List Address</span> <a href="#" class="right_bt"
				id="activator"><img
				src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/search.png"
				alt="" title="" border="0" /> </a>
		</div>
		<div class="box" id="box">
			<div class="box_content">
				<div class="box_content_tab">Search</div>
				<div class="box_content_center">
					<div class="form_content">
						<form action="<{$APPLICATION_URL}>/<{$ownerName}>Search"
							method="post">
							<input name="name" type="text" id="searchf"
								class="form_input_box" /> <input name="module" type="hidden"
								class="input-text" value="<{$moduleName}>" /> <a
								class="boxclose" id="boxclose">Close</a> <input type="submit"
								title="submit" class="form_submit" value="Submit" />
						</form>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<div class="box" id="box_share">
			<div class="box_content">
				<div class="box_content_tab">Join Us On</div>
				<div class="box_content_center">
					<div class="social_share">
						<ul>
							<{if $ownerFacebook != ""}>
							<li><a href="<{$ownerFacebook}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/facebook.png"
									alt="Join Us On Facebook" border="0" /> </a></li> <{/if}> <{if
							$ownerTwitter != ""}>
							<li><a href="<{$ownerTwitter}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/twitter.png"
									alt="Join Use On Twitter" border="0" /> </a></li> <{/if}> <{if
							$ownerLinkin != ""}>
							<li><a href="<{$ownerLinkin}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/linkedin.png"
									alt="Join Us In Linkedin" border="0" /> </a></li> <{/if}> <{if
							$ownerDribbble != ""}>
							<li><a href="<{$ownerDribbble}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/dribbble.png"
									alt="Join Us In Dribbble" border="0" /> </a></li> <{/if}> <{if
							$ownerDigg != ""}>
							<li><a href="<{$ownerDigg}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/digg.png"
									alt="Join Us In Digg" border="0" /> </a></li> <{/if}> <{if
							$ownerVimeo != ""}>
							<li><a href="<{$ownerVimeo}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/vimeo.png"
									alt="Join Us In Vimeo" border="0" /> </a></li> <{/if}> <{if
							$ownerYoutube != ""}>
							<li><a href="<{$ownerYoutube}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/youtube.png"
									alt="Join Us In Youtube" border="0" /> </a></li> <{/if}> <{if
							$ownerForrst != ""}>
							<li><a href="<{$ownerForrst}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/forrst.png"
									alt="Join Us In Forrst" border="0" /> </a></li> <{/if}> <{if
							$ownerFlickr != ""}>
							<li><a href="<{$ownerFlickr}>" target="blank"><img
									src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/social/flickr.png"
									alt="Join Us In Flickr" border="0" /> </a></li> <{/if}>
						</ul>
					</div>

					<a class="boxclose_right" id="boxclose_share">close</a>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<div class="content">
			<div class="corner_wrap">
				<div class="box_content_center">
					<div class="form_content">
						<{assign var=i value=0}>
						<{assign var=j value=10}>
						<{foreach item=addressEntity from=$listAddress}>
						<div>
							<span style="float: right;"><span class=""><a id="tdb<{$i}>" href="<{$APPLICATION_URL}>/<{$ownerName}>MyAccount/editAddress/id/<{$addressEntity->id}>" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-document"></span>Edit</a></span><script type="text/javascript">$("#tdb<{$i}>").button({icons:{primary:"ui-icon-document"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script> <span class=""><a id="tdb<{$j}>" href="<{$APPLICATION_URL}>/<{$ownerName}>MyAccount/deleteAddress/id/<{$addressEntity->id}>" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary ui-priority-secondary" role="button"><span class="ui-button-icon-primary ui-icon ui-icon-trash"></span>Delete</a></span><script type="text/javascript">$("#tdb<{$j}>").button({icons:{primary:"ui-icon-trash"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script></span>
							<p><strong><{$addressEntity->getName()}></strong>&nbsp;<{if $addressEntity->id == $mainAddressId}><small><i>(primary address)</i></small><{/if}></p>
							<p style="padding-left: 20px;"><{$addressEntity->getName()}><br> <{$addressEntity->street}><br> <{$addressEntity->getState()}>, <{$addressEntity->city}>    <{$addressEntity->postcode}><br> <{$addressEntity->getCountry()}></p>
	  
						</div>
						<{assign var=i value=$i+1}>
						<{assign var=j value=$j+1}>
						 <{/foreach}>
					
					</div>
				</div>
				<div class="clear_left"></div>
			</div>
		</div>
		<div id="footer">
			<{if $ownerTwitter != "" || $ownerDribbble != "" || $ownerDigg != ""
			|| $ownerVimeo != "" || $ownerYoutube != "" || $ownerForrst != "" ||
			$ownerFlickr != "" || $ownerFacebook != "" || $ownerLinkin != ""}> <a
				href="#" class="left_bt" id="activator_share">Follow</a> <{/if}> <span><small>
					&copy; <{$smarty.now|date_format:"%Y"}> <{$ownerFullName}>. All
					rights reserved <{if $isBrandingFree == false}> , powered by <a
					href="http://www.slappit.com"
					title="Slappit.com - Ecommerce Websites From &pound;5 A Month">Slappit.com</a>
					<{/if}> </small> </span> <a
				onclick="jQuery('html, body').animate( { scrollTop: 0 }, 'slow' );"
				href="" title="Go on top" class="right_bt"><img
				src="<{$APPLICATION_URL}>/Themes/<{$templateName}>/images/top.png"
				alt="" title="" border="0" /> </a>
		</div>

<script type="text/javascript">
<!--
//-->
var olderCountryId=-1;
function selectCountryChange(countryId)
{
	
	if(olderCountryId==countryId) return;
	olderCountryId=countryId;
		
		$.ajax({
			  url: '<{$APPLICATION_URL}>/<{$ownerName}>Ajax/statebycountry',
			  data: 'countryId='+countryId,
			  type: 'post',
			  success: function(result)
			  {
				
				  $("#ajaxState").html(result);
				  
			  },
			});
}	
</script>
		
<script type="text/javascript"><!--
var form = "";
var submitted = false;
var error = false;
var error_message = "";

function check_input(field_name, field_size, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value.length < field_size) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_radio(field_name, message) {
  var isChecked = false;

  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var radio = form.elements[field_name];

    for (var i=0; i<radio.length; i++) {
      if (radio[i].checked == true) {
        isChecked = true;
        break;
      }
    }

    if (isChecked == false) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_select(field_name, field_default, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == field_default) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {
  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
    var password = form.elements[field_name_1].value;
    var confirmation = form.elements[field_name_2].value;

    if (password.length < field_size) {
      error_message = error_message + "* " + message_1 + "\n";
      error = true;
    } else if (password != confirmation) {
      error_message = error_message + "* " + message_2 + "\n";
      error = true;
    }
  }
}

function check_form() {
  if (submitted == true) {
    alert("This form has already been submitted. Please press Ok and wait for this process to be completed.");
    return false;
  }

  error = false;  
  form = document.create_account;
  error_message = "Errors have occured during the process of your form.\n\nPlease make the following corrections:\n\n";

  check_radio("gender", "Please select your Gender.");

  check_input("firstName", 2, "Your First Name must contain a minimum of 2 characters.");
  check_input("lastName", 2, "Your Last Name must contain a minimum of 2 characters.");

  check_input("dob", 10, "Your Date of Birth must be in this format: MM/DD/YYYY (eg 05/21/1970)");

  check_input("email", 6, "Your E-Mail Address must contain a minimum of 6 characters.");
  check_input("street", 5, "Your Street Address must contain a minimum of 5 characters.");
  check_input("zipCode", 4, "Your Post Code must contain a minimum of 4 characters.");
  check_input("city", 3, "Your City must contain a minimum of 3 characters.");

  check_input("state", 2, "Your State must contain a minimum of 2 characters.");

  check_select("country", "", "You must select a country from the Countries pull down menu.");

  check_input("telephone", 3, "Your Telephone Number must contain a minimum of 3 characters.");

  check_password("password", "confirmation", 5, "Your Password must contain a minimum of 5 characters.", "The Password Confirmation must match your Password.");
  check_password("password_new", "password_confirmation", 5, "Your new Password must contain a minimum of 5 characters.", "The Password Confirmation must match your new Password.");

  if (error == true) {
    alert(error_message);
    return false;
  } else {
    submitted = true;
	
	form.actionForm.value="submit";
	form.submit();
    return true;
  }
}

//--></script>

</body>
</html>
